﻿using System;
using System.Windows.Forms;

namespace PSSymbolStore.Manager.Windows
{
    public partial class SymbolStoreErrorForm : Form
    {
        public SymbolStoreErrorForm()
        {
            InitializeComponent();
        }

        public string SymbolServerPath { get; set; }

        private void SymbolStoreErrorForm_Load(object sender, EventArgs e)
        {
            // Always hide the troubleshooting button - it's stupid. :)
            // (and my troubleshooting pack isn't signed with a trusted cert.)
            //btnTroubleshoot.Visible = Utilities.IsWindows7();
            labelStoreLocation.Text = SymbolServerPath;
        }

        private void btnTroubleshoot_Click(object sender, EventArgs e)
        {
            new TroubleshootingInvoker().Invoke(SymbolServerPath);
        }

        public static void Show(string symbolServerPath)
        {
            var form = new SymbolStoreErrorForm {SymbolServerPath = symbolServerPath};
            form.ShowDialog();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }
    }
}
